<template>
  <div class="custom-form">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
        :key="showFormKey">
        <!-- 合同审批 -->
        <el-col :span="24">
          <el-form-item label-width="0" prop="field1004bfa">
            <h2 align='center' style="color:undefined;font-size: nullpx;text-align: center">合同审批</h2>
          </el-form-item>
        </el-col>
        <!-- 当前用户 -->
        <el-col :span="24" v-if="hasFormPermission('current_user_id')" v-show="false">
          <el-form-item :label="$t('当前用户')" prop="current_user_id">
            <avue-information-body :operationVal="operationVal" infoType='user'
              :whetherToRebindSecondaryEditing='false' v-model="formData['current_user_id']"
              placeholder="当前用户" :disabled="hasDisabledPermission('current_user_id',true)"
              :readonly="!hasEditPermission('current_user_id',true)" :style="{width: '100%'}">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <!-- 职级名称 -->
        <el-col :span="24" v-if="hasFormPermission('job')" v-show="false">
          <el-form-item :label="$t('职级名称')" prop="job">
            <el-input v-model="formData['job']" placeholder="请输入职级名称"
              :disabled="hasDisabledPermission('job',false)"
              :readonly="!hasEditPermission('job',false)" clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 角色id -->
        <el-col :span="24" v-if="hasFormPermission('role_id')" v-show="false">
          <el-form-item :label="$t('角色id')" prop="role_id">
            <el-input v-model="formData['role_id']" placeholder="请输入角色id"
              :disabled="hasDisabledPermission('role_id',false)"
              :readonly="!hasEditPermission('role_id',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 角色名称 -->
        <el-col :span="24" v-if="hasFormPermission('role_name')" v-show="false">
          <el-form-item :label="$t('角色名称')" prop="role_name">
            <el-input v-model="formData['role_name']" placeholder="请输入角色名称"
              :disabled="hasDisabledPermission('role_name',false)"
              :readonly="!hasEditPermission('role_name',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请人id -->
        <el-col :span="24" v-if="hasFormPermission('user_id')" v-show="false">
          <el-form-item :label="$t('申请人id')" prop="user_id">
            <el-input v-model="formData['user_id']" placeholder="请输入申请人id"
              :disabled="hasDisabledPermission('user_id',false)"
              :readonly="!hasEditPermission('user_id',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请人名称 -->
        <el-col :span="24" v-if="hasFormPermission('user_name')">
          <el-form-item :label="$t('申请人名称')" prop="user_name">
            <el-input v-model="formData['user_name']" placeholder="请输入申请人名称"
              :disabled="hasDisabledPermission('user_name',false)"
              :readonly="true" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 地区 -->
        <el-col :span="24" v-if="hasFormPermission('area')" v-show="false">
          <el-form-item :label="$t('地区')" prop="area">
            <el-input v-model="formData['area']" placeholder="请输入地区"
              :disabled="hasDisabledPermission('area',false)"
              :readonly="!hasEditPermission('area',false)" clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 部门简称 -->
        <el-col :span="24" v-show="false">
          <el-form-item :label="$t('部门简称')" prop="depart_short_name">
            <el-input v-model="formData['depart_short_name']" placeholder="请输入部门简称"
              :disabled="hasDisabledPermission('depart_short_name',false)"
              :readonly="!hasEditPermission('depart_short_name',false)" clearable
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 部门id -->
        <el-col :span="24" v-if="hasFormPermission('depart_id')">
          <el-form-item :label="$t('部门')" prop="depart_id">
            <el-select v-model="formData['depart_id']" placeholder="请选择部门ID"
              :disabled="hasDisabledPermission('depart_id',false)" filterable clearable
              @change="Handleselect"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in depart_idOptions" :key="index" :label="item.F_ShortName"
                :value="item.F_DepartmentId" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 是否生效 -->
        <el-col :span="24" v-if="hasFormPermission('is_effective')" v-show="false">
          <el-form-item :label="$t('是否生效')" prop="is_effective">
            <el-input v-model="formData['is_effective']" placeholder="请输入是否生效"
              :disabled="hasDisabledPermission('is_effective',false)"
              :readonly="!hasEditPermission('is_effective',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请时间 -->
        <el-col :span="24" v-if="hasFormPermission('apply_time')" v-show="false">
          <el-form-item :label="$t('申请时间')" prop="apply_time">
            <avue-information-body :operationVal="operationVal" infoType='date'
              :whetherToRebindSecondaryEditing='false' v-model="formData['apply_time']" placeholder="当前时间"
              :disabled="hasDisabledPermission('apply_time',true)"
              :readonly="!hasEditPermission('apply_time',true)" :style="{width: '100%'}">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <!-- 合同金额 -->
        <el-col :span="24" v-if="hasFormPermission('contract_amount')">
          <el-form-item :label="$t('合同金额')" prop="contract_amount">
            <el-input v-model="formData['contract_amount']" type="number" placeholder="请输入合同金额"
              :disabled="hasDisabledPermission('contract_amount',false)"
              :readonly="!hasEditPermission('contract_amount',false)" clearable :style="{width: '100%'}">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 付款方式 -->
        <el-col :span="24" v-if="hasFormPermission('payment_ways')">
          <el-form-item :label="$t('付款方式')" prop="payment_ways">
            <el-select v-model="formData['payment_ways']" placeholder="请选择付款方式"
              :disabled="hasDisabledPermission('payment_ways',false)" filterable clearable
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in payment_waysOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 合同审批部门 -->
        <el-col :span="24" v-if="hasFormPermission('contract_approval_department')">
          <el-form-item :label="$t('合同审批部门')" prop="contract_approval_department">
            <!-- <avue-input-tree v-model="formData['contract_approval_department']"
              :disabled="hasDisabledPermission('contract_approval_department',false)"
              placeholder="系统默认(公司)合同审批部门" type="tree" :dic="contract_approval_departmentOptions"
              :style="{width: '100%'}"></avue-input-tree> -->
              <SelectOnlyDepartment @sendData="sendData1" />
          </el-form-item>
        </el-col>
        <!-- 合同名称 -->
        <el-col :span="24" v-if="hasFormPermission('contract_name')">
          <el-form-item :label="$t('合同名称')" prop="contract_name">
            <el-input v-model="formData['contract_name']" placeholder="请输入合同名称"
              :disabled="hasDisabledPermission('contract_name',false)"
              :readonly="!hasEditPermission('contract_name',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 合同主体 -->
        <el-col :span="24" v-if="hasFormPermission('contract_main')">
          <el-form-item :label="$t('合同主体')" prop="contract_main">
            <el-select v-model="formData['contract_main']" placeholder="请选择合同主体"
              :disabled="hasDisabledPermission('contract_main',false)" filterable clearable
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in contract_mainOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 合同选项 -->
        <el-col :span="24" v-if="hasFormPermission('contract_options')">
          <el-form-item :label="$t('合同选项')" prop="contract_options">
            <el-select v-model="formData['contract_options']" placeholder="请选择合同选项"
              :disabled="hasDisabledPermission('contract_options',false)" filterable clearable
              @change="selectContractOptions"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in contract_optionsOptions" :key="index"
                :label="item.F_ItemName" :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 合同类别 -->
        <el-col :span="24" v-if="hasFormPermission('contract_type')">
          <el-form-item :label="$t('合同类别')" prop="contract_type">
            <el-select v-model="formData['contract_type']" placeholder="请选择合同类别"
              :disabled="hasDisabledPermission('contract_type',false)" filterable clearable
              @change="selectContractType"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in contract_typeOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 合同类别其他说明 -->
        <el-col :span="24" v-if="hasFormPermission('contract_type_other_desc')" v-show="contractTypeOtherDescFlag">
          <el-form-item :label="$t('合同类别其他说明')" prop="contract_type_other_desc">
            <el-input v-model="formData['contract_type_other_desc']" type="textarea" placeholder="请输入合同类别其他说明"
              :disabled="hasDisabledPermission('contract_type_other_desc',false)"
              :readonly="!hasEditPermission('contract_type_other_desc',false)"
              :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 合同编号 -->
        <el-col :span="24" v-if="hasFormPermission('contract_number')">
          <el-form-item :label="$t('合同编号')" prop="contract_number">
            <el-input v-model="formData['contract_number']" placeholder="请输入合同编号"
              :disabled="hasDisabledPermission('contract_number',false)"
              :readonly="!hasEditPermission('contract_number',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 项目名称 -->
        <el-col :span="24" v-if="hasFormPermission('project_name')">
          <el-form-item :label="$t('项目名称')" prop="project_name">
            <el-input v-model="formData['project_name']" placeholder="请输入项目名称"
              :disabled="hasDisabledPermission('project_name',false)"
              :readonly="!hasEditPermission('project_name',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 项目数量 -->
        <el-col :span="24" v-if="hasFormPermission('project_number')" v-show="projectFlag">
          <el-form-item :label="$t('项目数量')" prop="project_number">
            <el-input v-model.number="formData['project_number']" placeholder="请输入项目数量"
              :disabled="hasDisabledPermission('project_number',false)"
              :readonly="!hasEditPermission('project_number',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 项目型号 -->
        <el-col :span="24" v-if="hasFormPermission('project_model')" v-show="projectFlag">
          <el-form-item :label="$t('项目型号')" prop="project_model">
            <el-input v-model="formData['project_model']" placeholder="请输入项目型号"
              :disabled="hasDisabledPermission('project_model',false)"
              :readonly="!hasEditPermission('project_model',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 交期时间 -->
        <el-col :span="24" v-if="hasFormPermission('delivery_date')" v-show="projectFlag || deliveryFlag">
          <el-form-item :label="$t('交期时间')" prop="delivery_date">
            <el-input v-model="formData['delivery_date']" placeholder="请输入交期时间"
              :disabled="hasDisabledPermission('delivery_date',false)"
              :readonly="!hasEditPermission('delivery_date',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 签订日期 -->
        <el-col :span="24" v-if="hasFormPermission('sign_date')">
          <el-form-item :label="$t('签订日期')" prop="sign_date">
            <el-date-picker :disabled="hasDisabledPermission('sign_date',false)"
              :readonly="!hasEditPermission('sign_date',false)" v-model="formData['sign_date']"
              format="yyyy-MM-dd" value-format="yyyy-MM-dd" :style="{width: '100%'}" placeholder="请选择签订日期"
              clearable></el-date-picker>
          </el-form-item>
        </el-col>
        <!-- 对方名称 -->
        <el-col :span="24" v-if="hasFormPermission('opposite_name')">
          <el-form-item :label="$t('对方名称')" prop="opposite_name">
            <el-input v-model="formData['opposite_name']" placeholder="请输入对方名称"
              :disabled="hasDisabledPermission('opposite_name',false)"
              :readonly="!hasEditPermission('opposite_name',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 对方联系人 -->
        <el-col :span="24" v-if="hasFormPermission('opposite_contact ')">
          <el-form-item :label="$t('对方联系人')" prop="opposite_contact ">
            <el-input v-model="formData['opposite_contact ']" placeholder="请输入对方联系人"
              :disabled="hasDisabledPermission('opposite_contact ',false)"
              :readonly="!hasEditPermission('opposite_contact ',false)" clearable
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 我方联系人 -->
        <el-col :span="24" v-if="hasFormPermission('our_contact')">
          <el-form-item :label="$t('我方联系人')" prop="our_contact">
            <!-- <el-input v-model="formData['our_contact']" placeholder="请输入我方联系人"
              :disabled="hasDisabledPermission('our_contact',false)"
              :readonly="!hasEditPermission('our_contact',false)" clearable :style="{width: '100%'}">
            </el-input> -->
            <SelectOneStaff @transmissionData="transmissionData" />
          </el-form-item>
        </el-col>
        
        <!-- 特殊条款 -->
        <el-col :span="24" v-if="hasFormPermission('special_clause')">
          <el-form-item :label="$t('特殊条款')" prop="special_clause">

            <!-- <el-input v-model="formData['special_clause']" placeholder="请输入特殊条款"
              :disabled="hasDisabledPermission('special_clause',false)"
              :readonly="!hasEditPermission('special_clause',false)" clearable :style="{width: '100%'}">
            </el-input> -->
            
            <div class="special-item-add">
               <el-link type="primary" @click="addDetails">增加明细</el-link>
            </div>
            <div class="special-item-add" v-for="(item,index) in formData.details" :key="index">
               明细{{index+1}}&nbsp;<el-input class="el_ipuyt" v-model="item.content" placeholder="请输入内容"></el-input>&nbsp;<el-link type="primary" @click="deleteDetailds(index)">删除</el-link>
            </div>

          </el-form-item>
        </el-col>
        <!-- 合同扫描件 -->
        <el-col :span="24" v-if="hasFormPermission('contract_url')">
          <el-form-item :label="$t('合同扫描件')" prop="contract_url">
            <xjr-custom-upload :config="contract_urlConfig"
              :disabled="hasDisabledPermission('contract_url',false)" v-model="formData['contract_url']"
              list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <!-- 合同附件/保密协议/环保协议 -->
        <el-col :span="24" v-if="hasFormPermission('contract_file')">
          <el-form-item :label="$t('合同附件/保密协议/环保协议')" prop="contract_file">
            <xjr-custom-upload :config="contract_fileConfig"
              :disabled="hasDisabledPermission('contract_file',false)"
              v-model="formData['contract_file']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="0" prop="field133409c">
            <div style="border-top: 1px solid #dcdfe6;margin-top: 0px;margin-bottom: 0px;"></div>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasWorkFlowFormPermission('field134744d')" v-show="optionsFlag">
          <el-form-item :label="$t('意见簿')" prop="field134744d">
            <xjr-opinion-comonent :value="formData.field134744d"></xjr-opinion-comonent>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="!isWorkflowForm">
          <el-form-item size="large" v-if="isEdit">
            <el-button type="primary" @click="submitForm" :loading="submitLoading">
              {{submitLoading?$t('workFlow.WFMenu.hintSubmit'):$t('submit')}}</el-button>
            <el-button @click="cancelForm">{{$t('cancelText')}}</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>

  import FilterableDataList from '@/components/generator/clientComponents/FilterableDataList.vue';
  import workflowFormAuthorize from "@/mixins/workflowFormAuthorize";
  import authorizeMixin from "@/mixins/authorize";
  import { baseUrl } from "@/config/env";
  import SelectOneStaff from '@/components/staffSelector/selectOneStaff.vue'
  import request from "@/router/axios";
  import SelectOnlyDepartment from '@/components/staffSelector/selectOnlyDepartment.vue'
  import {getUserDetailsById} from '@/api/user.js';
  export default {
    mixins: [authorizeMixin,workflowFormAuthorize],
    components: {SelectOneStaff,SelectOnlyDepartment},
    props: ['keyValue', 'isEdit', 'disabled'],
    data() {
      let _this = this
      return {
        submitLoading: false,
        showForm: true,
        showFormKey: 1,
        reRenderSubform: false,
        contractTypeOtherDescFlag:false,
        operationVal: 'add',
        isAdd: true,
        addressUrl:'contractapprovaling',
        mainTableName: 'oa_contract_approvaling',
        formConfig: {},
        formData: {
          'field1004bfa': '',
          'current_user_id': '',
          'job': '',
          'role_id': '',
          'role_name': '',
          'user_id': '',
          'user_name': '',
          'area': '',
          'depart_short_name': '',
          'depart_id': '',
          'is_effective': '0',
          'apply_time': '',
          'contract_amount': "",
          'payment_ways': '',
          'contract_approval_department': '',
          'contract_name': '',
          'contract_main': '',
          'contract_options': '',
          'contract_type': '',
          'contract_type_other_desc': '',
          'contract_number': '',
          'project_name': '',
          'project_number': '',
          'project_model': '',
          'sign_date': null,
          'delivery_date': '',
          'opposite_name': '',
          'our_contact': '',
          'opposite_contact ': '',
          'special_clause': '',
          details:[{content:''}],
          'contract_url': null,
          'contract_file': null,
          'field133409c': '',
          'field134744d': null,
        },
        rules: {
          job: [{
            required: true,
            message: '请输入职级名称',
            trigger: 'blur'
          }],
          role_id: [{
            required: true,
            message: '请输入角色id',
            trigger: 'blur'
          }],
          role_name: [{
            required: true,
            message: '请输入角色名称',
            trigger: 'blur'
          }],
          user_id: [{
            required: true,
            message: '请输入申请人id',
            trigger: 'blur'
          }],
          user_name: [{
            required: true,
            message: '请输入申请人名称',
            trigger: 'blur'
          }],
          area: [{
            required: true,
            message: '请输入地区',
            trigger: 'blur'
          }],
          depart_short_name: [{
            required: true,
            message: '请输入部门简称',
            trigger: 'blur'
          }],
          depart_id: [{
            required: true,
            message: '请选择部门ID',
            trigger: 'change'
          }],
          is_effective: [{
            required: true,
            message: '请输入是否生效',
            trigger: 'blur'
          }],
          contract_amount: [{
            required: true,
            message: '请输入合同金额',
            trigger: 'blur'
          }],
          payment_ways: [{
            required: true,
            message: '请选择付款方式',
            trigger: 'change'
          }],
          contract_approval_department: [],
          contract_name: [{
            required: true,
            message: '请输入合同名称',
            trigger: 'blur'
          }],
          contract_main: [{
            required: true,
            message: '请选择合同主体',
            trigger: 'change'
          }],
          contract_options: [{
            required: true,
            message: '请选择合同选项',
            trigger: 'change'
          }],
          contract_type: [{
            required: true,
            message: '请选择合同类别',
            trigger: 'change'
          }],
          contract_type_other_desc: [{
            required: false,
            message: '请输入合同类别其他说明',
            trigger: 'blur'
          }],
          contract_number: [{
            required: true,
            message: '请输入合同编号',
            trigger: 'blur'
          }],
          project_name: [{
            required: true,
            message: '请输入项目名称',
            trigger: 'blur'
          }],
          project_number: [{
            required: false,
            message: '请输入项目数量',
            trigger: 'blur'
          }],
          project_model: [{
            required: false,
            message: '请输入项目型号',
            trigger: 'blur'
          }],
          sign_date: [{
            required: true,
            message: '请选择签订日期',
            trigger: 'change'
          }],
          delivery_date: [{
            required: false,
            message: '请输入交期时间',
            trigger: 'blur'
          }],
          opposite_name: [{
            required: true,
            message: '请输入对方名称',
            trigger: 'blur'
          }],
          our_contact: [{
            required: true,
            message: '请输入我方联系人',
            trigger: 'blur'
          }],
          opposite_contact: [{
            required: true,
            message: '请输入对方联系人',
            trigger: 'blur'
          }],
          special_clause: [{
            required: false,
            message: '请输入特殊条款',
            trigger: 'blur'
          }],
          contract_url: [{
            required: true,
            message: '合同扫描件不能为空',
            trigger: 'change'
          }],
          contract_file: [{
            required: false,
            message: '合同附件/保密协议/环保协议不能为空',
            trigger: 'change'
          }],
        },
        payment_waysOptions: [],
        contract_approval_departmentOptions: undefined,
        contract_mainOptions: [],
        contract_optionsOptions: [],
        contract_typeOptions: [],
        contract_urlConfig: {
          "showTip": false,
          "fileSize": 2,
          "sizeUnit": "MB",
          "buttonText": "点击上传",
          "disabled": false
        },
        contract_fileConfig: {
          "showTip": false,
          "fileSize": 2,
          "sizeUnit": "MB",
          "buttonText": "点击上传",
          "disabled": false
        },
        depart_idOptions: [],
        projectFlag:false,
        deliveryFlag:false,
      }
    },
    computed: {},
    watch: {
      'formData.contract_amount': function(val, oldVal) {
        this.changeFormConfigDefaultValue();
      },
    },
    created() {
      this.formConfig = this.getFormConfig();
    },
    async mounted() {
      //TODO   再这里做数据回填 请求表单数据
      if(this.keyValue){
          this.isAdd = false;
      }
      if(!this.isAdd&&this.keyValue){
          this.operationVal = 'edit';
          try {
            let res = await request({
              url: baseUrl + "/"+this.addressUrl+"/" + this.keyValue,
              method: "get",
            });
              
        this.formData = res.data.data
        
              this.showFormKey++;
          } catch (error) {
          }
      }
      if (typeof this.getPayment_waysOptions == "function") {
        await this.getPayment_waysOptions();
      }
      if (typeof this.getContract_approval_departmentOptions == "function") {
        await this.getContract_approval_departmentOptions();
      }
      if (typeof this.getContract_mainOptions == "function") {
        await this.getContract_mainOptions();
      }
      if (typeof this.getContract_optionsOptions == "function") {
        await this.getContract_optionsOptions();
      }
      if (typeof this.getContract_typeOptions == "function") {
        await this.getContract_typeOptions();
      }
      //获取用户详情
      setTimeout(() => {
        this.getUserInfo()
      }, 0);
    },
    methods: {
      transmissionData(value){
        this.formData['our_contact'] = value
      },
      selectContractType(){
        if(this.formData['contract_type'] == 8){
          this.contractTypeOtherDescFlag = true
        }else{
          this.contractTypeOtherDescFlag = false
        }
      },
      addDetails(){
        this.formData.details.push({content:''})
      },
      deleteDetailds(i){
        this.formData.details.splice(i,1)
      },
      //1、采购合同 2、技术合同 3、专利代理 4、总包合同 5、分包合同 6、租赁合同 7、其他合同
      // 采购合同、专利代理、总包合同、分包合同、其他合同
      //     出现
      //     项目数量、项目型号、交期时间
      //     技术合同、出现交期时间 
      selectContractOptions(){
        if((this.formData['contract_options'] == 1) || (this.formData['contract_options'] == 3) || (this.formData['contract_options'] == 4) || (this.formData['contract_options'] == 5) || (this.formData['contract_options'] == 7)){
          this.projectFlag = true
        }else{
          this.projectFlag = false
        }

        if(this.formData['contract_options'] == 2){
          this.deliveryFlag = true
        }else{
          this.deliveryFlag = false
        }
      },
      getUserInfo(){
            let params = {
              userId:this.formData['current_user_id']
            }
            getUserDetailsById(params).then(res => {
              if(res.data.success){
                this.formData['job'] = res.data.data.F_Job
                this.formData['area'] = res.data.data.F_Area
                this.formData['user_id'] = this.formData['current_user_id']
                this.formData['user_name'] = res.data.data.F_RealName
                this.depart_idOptions = res.data.data.F_Department
                this.roleData = res.data.data.F_Role
                this.initRole()
                this.initDepartmentData()
              }
            })
      },
      initDepartmentData(){
        if(this.depart_idOptions && this.depart_idOptions.length == 1){
          this.formData['depart_short_name'] = this.depart_idOptions[0].F_FullName
          this.formData['depart_id'] = this.depart_idOptions[0].F_DepartmentId
        }
      },
      Handleselect(){
        if(this.depart_idOptions && this.depart_idOptions.length > 0){
          this.depart_idOptions.forEach(e => {
            if(e.F_DepartmentId == this.formData['depart_id']){
              this.formData['depart_short_name'] = e.F_ShortName
            }
          })
        }
      },
      initRole(){
          let roleId = []
          let roleName = []
          if(this.roleData && this.roleData.length > 0){
            this.roleData.forEach(e => {
              roleId.push(e.F_RoleId)
              roleName.push(e.F_FullName)
            })
          }
          this.formData['role_id'] = roleId.join(',')
          this.formData['role_name'] = roleName.join(',')
      },
      getFormData() {
        let key = this.mainTableName + 'Entity';
        let returnParams = {};
        returnParams[key] = this.formData;
        return {
          ...returnParams,
        };
      },
      validateForm() {
        this.$refs['elForm'].validate(valid => {});
      },
      async aysncValidateForm() {
        let validataArry = []
        validataArry.push(new Promise((resolve, reject) => {
          this.$refs['elForm'].validate(valid => {
            resolve(valid)
          })
        }))
        let res = await Promise.all(validataArry)
        if (res.includes(false)) {
          return false
        }
        else {
          return true;
        }
      },
      changeTableData() {},
      async submitForm() {
        this.submitLoading = true;
        let valid = await this.aysncValidateForm();
        if (valid == false) {
          this.submitLoading = false;
          return false;
        }
        this.changeTableData();
        //格式化数据
        let newObj = this.getFormData();
        
          //如果没有传入参数就是新增
          if (!this.keyValue) {

            request({
              url: baseUrl + "/"+this.addressUrl,
              method: "post",
              data : newObj
            }).then((res) => {
              this.submitLoading = false;
              this.$notify({
                title: "成功",
                message: "新增成功",
                type: "success",
              });
              this.$emit("onChange",true)
            });

          }
          else{

          request({
              url: baseUrl + "/"+this.addressUrl+"/" + this.keyValue,
              method: "put",
              data : newObj
            }).then((res) => {
              this.submitLoading = false;
              this.$notify({
                title: "成功",
                message: "修改成功",
                type: "success",
              });
              this.$emit("onChange",true)
            });

          }
        
        
        
      },
      sendData1(value){
        this.formData['contract_approval_department'] = value
      },
      cancelForm() {
        this.$emit("onChange", true)
      },
      formatTree(data, valueField, lableField, childField, type) {
        let tree = [];
        data.forEach((node, index) => {
          let newNode = {
            value: node[valueField],
            label: node[lableField],
          };
          if (type) {
            newNode.disabled = node[valueField] == undefined ? true : false
          }
          tree.push(newNode);
          if (node[childField] != null && node[childField].length > 0) {
            newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
            type));
          }
        }, this);
        return tree;
      },
      //辅助工作流 审批(编辑) 预留方法
      handleEdit() {
      },
      getNumberFixed2(number) {
        let splitNum = ("" + number).replace(/(^0*)/g, "").split(".");
        let num = splitNum[0] == "" ? '0' : splitNum[0];
        if (splitNum.length > 1) {
          num += '.';
          let roundNum = 2; //保留两位小数
          for (let i = 0; i < roundNum; i++) {
            num += splitNum[1][i];
          }
        }
        return parseFloat(num);
      },
      changeFormConfigDefaultValue() {
        let valueForFormIdMap = new Map();
        this.formConfig.fields.forEach((ele) => {
          if (ele.__config__.componentName == "table") {
            ele.__config__.children.forEach((element) => {
              valueForFormIdMap.set(ele.__config__.formId + "-table-" + element.__config__.formId,
                element.__config__.defaultValue);
            });
          }
          else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
            let childrenObj = ele.__config__.childrenObj || {};
            let _arr = this.getValByTabs(childrenObj);
            _arr.map(item => {
              valueForFormIdMap.set(item.formId, item.defaultValue);
            });
          }
          else {
            valueForFormIdMap.set(ele.__config__.formId, this.formData[ele.__vModel__]);
          }
        });
        this.formConfig.fields.forEach((ele, index) => {
          if (ele.__config__.componentName == "table") {
            ele.__config__.children.forEach((element, childrenIndex) => {
              let defaultValue = 0;
              if (element.computationalConfiguration && element.computationalConfiguration.length > 0) {
                let formulaStr = "";
                element.computationalConfiguration.forEach((item) => {
                  if (item.type == "taxRate") {
                    //税率
                    if (element.taxRate >= 0) {
                      formulaStr += element.taxRate * 0.01;
                    }
                  }
                  else {
                    let eleValue = valueForFormIdMap.get(item.formId) || 0;
                    formulaStr += item.formId == 0 ? item.name : eleValue;
                  }
                });
                defaultValue = eval(formulaStr);
                defaultValue = this.getNumberFixed2(defaultValue);
                //大写
                if (element.isCapitalized) {
                  this.formConfig.fields[index].__config__.children[childrenIndex].__config__
                    .capitalizedValue = this.getCapitalizedMethod(defaultValue);
                }
                this.formConfig.fields[index].__config__.children[childrenIndex].__config__
                  .defaultValue = defaultValue;
                this.formData[element.__vModel__] = defaultValue;
              }
            });
          }
          else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
            let childrenObj = ele.__config__.childrenObj || {};
            //avue-tabs
            this.calcDefaultValueByTabs(ele.__config__.childrenObj, valueForFormIdMap);
          }
          else {
            let defaultValue = 0;
            if (ele.computationalConfiguration && ele.computationalConfiguration.length > 0) {
              let formulaStr = "";
              ele.computationalConfiguration.forEach((item) => {
                if (item.type == "taxRate") {
                  //税率
                  if (ele.taxRate >= 0) {
                    formulaStr += ele.taxRate * 0.01;
                  }
                }
                else {
                  let eleValue = valueForFormIdMap.get(item.formId) || 0;
                  formulaStr += item.formId == 0 ? item.name : eleValue;
                }
              });
              defaultValue = eval(formulaStr);
              defaultValue = this.getNumberFixed2(defaultValue);
              //大写
              if (ele.isCapitalized) {
                this.formConfig.fields[index].__config__.capitalizedValue = this.getCapitalizedMethod(
                  defaultValue);
              }
              this.formConfig.fields[index].__config__.defaultValue = defaultValue;
              this.formData[ele.__vModel__] = defaultValue;
            }
          }
        });
      },
      getValByTabs(childrenObj) {
        let _arr = [];
        if (!childrenObj || !(childrenObj instanceof Object)) return [];
        for (let key in childrenObj) {
          let children = childrenObj[key];
          children.map(item => {
            if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
              let cObj = item.__config__.childrenObj || {};
              _arr.push(...this.getValByTabs(item.__config__.childrenObj));
            }
            else {
              let _obj = {};
              _obj.formId = item.__config__.formId;
              _obj.defaultValue = this.formData[item.__vModel__];
              _arr.push(_obj);
            }
          });
        }
        return (() => {
          return _arr;
        })()
      },
      calcDefaultValueByTabs(childrenObj, valueForFormIdMap) {
        if (!childrenObj || !(childrenObj instanceof Object)) return;
        for (let key in childrenObj) {
          let children = childrenObj[key];
          children.map(item => {
            if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
              let cObj = item.__config__.childrenObj || {};
              this.calcDefaultValueByTabs(cObj, valueForFormIdMap);
            }
            else {
              let defaultValue = 0;
              if (item.computationalConfiguration && item.computationalConfiguration.length > 0) {
                let formulaStr = "";
                item.computationalConfiguration.forEach((c) => {
                  if (item.type == "taxRate") {
                    //税率
                    if (item.taxRate >= 0) {
                      formulaStr += item.taxRate * 0.01;
                    }
                  }
                  else {
                    let eleValue = valueForFormIdMap.get(c.formId) || 0;
                    formulaStr += c.formId == 0 ? c.name : eleValue;
                  }
                });
                defaultValue = eval(formulaStr);
                defaultValue = this.getNumberFixed2(defaultValue);
                item.__config__.defaultValue = defaultValue;
                this.formData[item.__vModel__] = defaultValue;
              }
            }
          });
        }
      },
      async getPayment_waysOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/fkfs/detail',
          });
          if (resp.data.data) {
            this.payment_waysOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      async getContract_approval_departmentOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/companies/departments/tree',
          });
          if (resp.data) {
            let {
              data
            } = resp.data
            this.contract_approval_departmentOptions = this.formatTree(data, 'F_DepartmentId', 'F_FullName',
              'children', 1);
          }
        }
        catch (error) {}
      },
      async getContract_mainOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/htzt/detail',
          });
          if (resp.data.data) {
            this.contract_mainOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      async getContract_optionsOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/htxx/detail',
          });
          if (resp.data.data) {
            this.contract_optionsOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      async getContract_typeOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/hetongshenpileibie/detail',
          });
          if (resp.data.data) {
            this.contract_typeOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      //子表单权限
      getAuthorityTableChildrenList(bindTable, children) {
        let column = [];
        if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
          let formSubEnCodeList = this.formEnCodeList[bindTable];
          if (children && children.length > 0) {
            column = children.map(ele2 => {
              if (formSubEnCodeList.includes(ele2.prop)) {
                ele2.hide = false;
              }
              else {
                ele2.hide = true;
              }
              if (ele2.hide == false) {
                //工作流中系统表单必填权限
                if (this.formSubTableNotRequiredList[bindTable] != undefined) {
                  if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                    ele2.required = false;
                  }
                  else {
                    ele2.required = true;
                  }
                }
                ele2.rules = [];
                if (ele2.required) {
                  ele2.rules = ele2.ruleList;
                }
                // disabled 属性
                if (this.formSubTableDisabledList[bindTable] != undefined) {
                  if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                    ele2.disabled = true;
                  }
                  else {
                    ele2.disabled = false;
                  }
                }
              }
              return ele2;
            });
          }
          return column;
        }
        else {
          return children;
        }
      },
      getFormConfig() {
        let config = {
          "fields": [{
            "__vModel__": "field1004bfa",
            "__config__": {
              "label": "合同审批",
              "showLabel": false,
              "titleColor": null,
              "fontSize": null,
              "tag": "h2",
              "span": 24,
              "align": "top",
              "justify": "start",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 100
            }
          }, {
            "__vModel__": "current_user_id",
            "__type__": "info",
            "infoType": "user",
            "__organize__": true,
            "__config__": {
              "label": "当前用户",
              "showLabel": true,
              "tag": "avue-information-body",
              "avueType": "information-body",
              "defaultValue": "316231f32f1f0e5a4c56bf855806b924",
              "required": false,
              "span": 24,
              "whetherToRebindSecondaryEditing": false,
              "bindTableField": "current_user_id",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 101,
              "placeholder": "当前用户",
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "job",
            "__config__": {
              "label": "职级名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 102,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "job",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "role_id",
            "__config__": {
              "label": "角色id",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 103,
              "fieldLength": 500,
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "role_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "role_name",
            "__config__": {
              "label": "角色名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 104,
              "fieldLength": 500,
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "role_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "user_id",
            "__config__": {
              "label": "申请人id",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 105,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "user_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "user_name",
            "__config__": {
              "label": "申请人名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 106,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "user_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "area",
            "__config__": {
              "label": "地区",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 107,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "area",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "depart_short_name",
            "__config__": {
              "label": "部门简称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 108,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "depart_short_name",
              "bindTableFieldType": "varchar"
            }
          }, 
          {
            "__vModel__": "depart_id",
            "__config__": {
              "label": "部门ID",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 109,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "depart_id",
              "bindTableFieldType": "varchar"
            }
          },
          {
            "__vModel__": "is_effective",
            "__config__": {
              "label": "是否生效",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 110,
              "fieldLength": "10",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "is_effective",
              "bindTableFieldType": "int"
            }
          }, {
            "__vModel__": "apply_time",
            "__type__": "info",
            "infoType": "date",
            "__organize__": true,
            "__config__": {
              "label": "申请时间",
              "showLabel": true,
              "tag": "avue-information-body",
              "avueType": "information-body",
              "defaultValue": "2022-07-14 17:20:38",
              "required": false,
              "span": 24,
              "whetherToRebindSecondaryEditing": false,
              "bindTableField": "apply_time",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 111,
              "placeholder": "当前时间",
              "fieldLength": "100",
              "bindTable": "oa_contract_approvaling",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "number",
            "__vModel__": "contract_amount",
            "computationalConfiguration": [],
            "append": "元",
            "__config__": {
              "label": "合同金额",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input",
              "defaultValue": "",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 112,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_amount",
              "bindTableFieldType": "double"
            }
          }, {
            "__vModel__": "payment_ways",
            "__config__": {
              "label": "付款方式",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 113,
              "dataType": "dataItem",
              "dataItem": "fkfs",
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "payment_ways",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "tree",
            "__vModel__": "contract_approval_department",
            "__type__": "department",
            "__organize__": true,
            "__config__": {
              "label": "合同审批部门",
              "showLabel": true,
              "required": false,
              "tag": "avue-input-tree",
              "dataKey": "data",
              "span": 24,
              "bindTableField": "contract_approval_department",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 114,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_name",
            "__config__": {
              "label": "合同名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 115,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_main",
            "__config__": {
              "label": "合同主体",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 116,
              "dataType": "dataItem",
              "dataItem": "htzt",
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_main",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_options",
            "__config__": {
              "label": "合同选项",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 117,
              "dataType": "dataItem",
              "dataItem": "htxx",
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_options",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_type",
            "__config__": {
              "label": "合同类别",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 118,
              "dataType": "dataItem",
              "dataItem": "hetongshenpileibie",
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_type",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "contract_type_other_desc",
            "__config__": {
              "label": "合同类别其他说明",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "textarea",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 119,
              "fieldLength": 2000,
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_type_other_desc",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_number",
            "__config__": {
              "label": "合同编号",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 120,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_number",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "project_name",
            "__config__": {
              "label": "项目名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 121,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "project_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "project_number",
            "__config__": {
              "label": "项目数量",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 122,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "project_number",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "project_model",
            "__config__": {
              "label": "项目型号",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 124,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "project_model",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "date",
            "__vModel__": "sign_date",
            "__config__": {
              "label": "签订日期",
              "tag": "el-date-picker",
              "avueType": "datetime",
              "defaultValue": null,
              "showLabel": true,
              "span": 24,
              "required": true,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 125,
              "fieldLength": "50",
              "bindTableFieldType": "datetime",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "sign_date"
            }
          }, {
            "__vModel__": "delivery_date",
            "__config__": {
              "label": "交期时间",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 126,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "delivery_date",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "opposite_name",
            "__config__": {
              "label": "对方名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 127,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "opposite_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "our_contact",
            "__config__": {
              "label": "我方联系人",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 129,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "our_contact",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "opposite_contact ",
            "__config__": {
              "label": "对方联系人",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 128,
              "fieldLength": "50",
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "opposite_contact ",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "special_clause",
            "__config__": {
              "label": "特殊条款",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 130,
              "fieldLength": 500,
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "special_clause",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_url",
            "__config__": {
              "label": "合同扫描件",
              "tag": "el-upload",
              "avueType": "upload",
              "defaultValue": null,
              "showLabel": true,
              "required": true,
              "span": 24,
              "showTip": false,
              "buttonText": "点击上传",
              "fileSize": 2,
              "sizeUnit": "MB",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 131,
              "fieldLength": 2000,
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_url",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "contract_file",
            "__config__": {
              "label": "合同附件/保密协议/环保协议",
              "tag": "el-upload",
              "avueType": "upload",
              "defaultValue": null,
              "showLabel": true,
              "required": true,
              "span": 24,
              "showTip": false,
              "buttonText": "点击上传",
              "fileSize": 2,
              "sizeUnit": "MB",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 132,
              "fieldLength": 2000,
              "bindTable": "oa_contract_approvaling",
              "bindTableField": "contract_file",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "field133409c",
            "__config__": {
              "label": "分割线",
              "showLabel": false,
              "direction": "horizontal",
              "contentPosition": "",
              "tag": "el-divider",
              "top": 0,
              "bottom": 0,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 133
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "field134744d",
            "__type__": "opinion",
            "__config__": {
              "label": "意见簿",
              "showLabel": true,
              "tag": "xjr-opinion-comonent",
              "defaultValue": null,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 134
            }
          }]
        };
        return config;
      },
    }
}

</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

.el-upload__tip {
  line-height: 1.2;
}
.special-item-add{
  width: 600px;
  height: 40px;
  display: flex;
  flex-direction: row;
}
.el_ipuyt{
  width: 300px;
}
</style>
